package com.woniuxy.classteacher.controller;

import com.woniuxy.classteacher.cofiguration.FileUploadProperties;
import com.woniuxy.classteacher.repository.VideoRepository;
import com.woniuxy.classteacher.service.*;
import com.woniuxy.classteacher.uitility.VideoUtil;
import com.woniuxy.commons.entity.*;
import com.woniuxy.commons.entity.wyh.TeacherInfo;
import com.woniuxy.commons.entity.wyh.TeamInfo;
import com.woniuxy.commons.exception.BzeducationException;
import com.woniuxy.commons.service.RemoteAnswerService;
import com.woniuxy.commons.service.RemotePaperService;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author 李英勇、牟强
 * @date 2020/7/16 - 16:18
 */
@RestController
public class ClassTeacherController extends BzeducationException {
    @Autowired
    private ClassTeacherService classTeacherService;
    @Autowired
    private FileUploadProperties fileUploadProperties;
    @Autowired
    private VideoRepository videoRepository;
    @Autowired
    private VideoService videoService;
    @Autowired
    private VideoRemarkService videoRemarkService;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    @Autowired
    private ClassScoreService classScoreService;
    @Autowired
    private BadStudentPoolService badStudentPoolService;
    @Autowired
    private RemoteAnswerService remoteAnswerService;
    @Autowired
    private RemotePaperService remotePaperService;
    @Autowired
    private QuitSchoolService quitSchoolService;
    @Autowired
    private ClassScoreInfoService classScoreInfoService;

    @RequestMapping("/allStudentInfo")
    public List<StudentInfo> all() {
        return classTeacherService.all();
    }


    /**
     * @Author: 李英勇
     * @Description: 视频上传
     * @DateTime: 2020/7/21 17:23
     * @Params: [vedio, file]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.String>
     */
    @RequestMapping("/upVideo")
    public ResponseEntity<String> upVideo(@RequestParam("knowledge") String knowledge, @RequestParam("open") int open, @RequestParam("content") String content, @RequestBody MultipartFile file, @RequestParam("refreshToken") String refreshToken) {
        Vedio vedio = new Vedio();
        vedio.setKnowledge(knowledge);
        vedio.setOpen(open);
        vedio.setContent(content);
        System.out.println(vedio);
        //将视频存如硬盘并返回路径
        System.out.println(file);
        String relPath = VideoUtil.storeImageReturnUrl(fileUploadProperties, file);
        System.out.println(relPath);
        vedio.setPath(relPath);
        //存入数据库
        videoService.upVideo(vedio, refreshToken);

        return new ResponseEntity<String>(ResponseEntity.SUCCESS, "上传成功", relPath);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过知识点模糊查询，默认按点赞数降序排序
     * @DateTime: 2020/7/21 16:42
     * @Params: [content]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.Vedio>>
     */
    @GetMapping("/findByContent/{content}")
    public ResponseEntity<List<Vedio>> findByContentLike(@PathVariable("content") String content, @RequestParam("page") int page, @RequestParam("limit") int limit) {

        System.out.println(content + ":" + page + ":" + limit);

        //构建查询条件
        NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder();
        //添加基本分词查询
        //模糊查询知识点和内容有关键字的，但是必须是审核通过的
        queryBuilder.withQuery(QueryBuilders.boolQuery().must(QueryBuilders.multiMatchQuery(content, "content", "knowledge"))
                .mustNot(QueryBuilders.termQuery("examine", 0)));
        //排序
        queryBuilder.withSort(SortBuilders.fieldSort("thumbsup").order(SortOrder.DESC));

        // 分页：
        page -= 1;
        queryBuilder.withPageable(PageRequest.of(page, limit));

        //搜索，获取结果
        Page<Vedio> videos = videoRepository.search(queryBuilder.build());
        System.out.println(videos);
        List<Vedio> list = new ArrayList<>();
        //总条数
        long total = videos.getTotalElements();
        System.out.println("总条数 = " + total);
        //总页数
        System.out.println("总页数 = " + videos.getTotalPages());
        //当前页
        System.out.println("当前页：" + videos.getNumber());
        //每页大小
        System.out.println("每页大小：" + videos.getSize());

        for (Vedio item : videos) {
            list.add(item);
        }
        return new ResponseEntity<List<Vedio>>(ResponseEntity.SUCCESS, "查询成功", list, total);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过vid和refreshToken判断用户是否有访问这个视频的权限
     * @DateTime: 2020/7/23 11:39
     * @Params: [vid, refreshToken]
     * @Return com.woniuxy.commons.entity.ResponseEntity<com.woniuxy.commons.entity.Vedio>
     */
    @GetMapping("/getVideoByVid/{vid}")
    public ResponseEntity<Vedio> getVideoByVid(HttpServletRequest request, @PathVariable("vid") int vid) {
        String refreshToken = request.getHeader("refreshToken");
        Vedio video = videoService.getVideoByVid(vid, refreshToken);
        if (video != null) {
            return new ResponseEntity<Vedio>(ResponseEntity.SUCCESS, "查询成功", video);
        }
        return new ResponseEntity<Vedio>(ResponseEntity.FAIL, "你没有权限", null);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过vid查询视频的评论
     * @DateTime: 2020/7/23 11:39
     * @Params: [vid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.VideoRemark>>
     */
    @GetMapping("/getVideoRemarkByVid/{vid}")
    public ResponseEntity<List<VideoRemark>> getVideoRemarkByVid(@PathVariable("vid") int vid, @RequestParam("page") int page, @RequestParam("limit") int limit) {
        page = (page - 1) * limit;
        long count = videoRemarkService.findRemarkCountByVid(vid);
        List<VideoRemark> remarks = videoRemarkService.findRemarkByVid(vid, page, limit);
        return new ResponseEntity<>(ResponseEntity.SUCCESS, "查询成功", remarks, count);
    }

    /**
     * @Author: 李英勇
     * @Description: 视频点赞
     * @DateTime: 2020/7/23 11:40
     * @Params: [vid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.String>
     */
    @PostMapping("/thumbsup")
    public ResponseEntity<Void> thumbsupVideoByVid(int vid) {
        videoService.thumbsupVideoByVid(vid);
        return new ResponseEntity<Void>(ResponseEntity.SUCCESS, "点赞成功");
    }

    /**
     * @Author: 李英勇
     * @Description: 视频评论
     * @DateTime: 2020/7/23 11:40
     * @Params: [videoRemark, refreshToken]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.String>
     */
    @PostMapping("/addRemark")
    public ResponseEntity<Void> addRemark(VideoRemark videoRemark, @RequestParam("refreshToken") String refreshToken) {
        System.out.println(videoRemark + ":" + refreshToken);
        videoRemarkService.addRemark(videoRemark, refreshToken);
        return new ResponseEntity<Void>(ResponseEntity.SUCCESS, "评论成功");
    }

    /**
     * @Author: 李英勇
     * @Description: 通过teacherid查询老师上传的视频
     * @DateTime: 2020/7/23 11:40
     * @Params: [teacherid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.Vedio>>
     */
    @GetMapping("/findVideoByTeacherid")
    public ResponseEntity<List<Vedio>> findVideoByTeacherid(HttpServletRequest request, @RequestParam("page") int page, @RequestParam("limit") int limit) {
        String refreshToken = request.getHeader("refreshToken");
        System.out.println(refreshToken);
        //通过refreshToken查询用户的rid和role
        Map<Object, Object> data = redisTemplate.opsForHash().entries(refreshToken);
        //
        int rid = (int) data.get("rid");
        String role = (String) data.get("role");
        if ("teacher".equals(role)) {
            page = (page - 1) * limit;
            List<Vedio> vedios = classTeacherService.findVedioByTeacherid(rid, page, limit);
            long count = classTeacherService.findVideoCountByTeacherid(rid);
            return new ResponseEntity<List<Vedio>>(ResponseEntity.SUCCESS, "查询成功", vedios, count);
        }
        return null;
    }

    /**
     * @Author: 李英勇
     * @Description: 修改视频知识点和描述
     * @DateTime: 2020/7/23 16:34
     * @Params: [vedio]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/updateVideo")
    public ResponseEntity<Void> updateVideo(Vedio vedio) {
        System.out.println(vedio);
        videoService.updateVideo(vedio);
        return new ResponseEntity<Void>(ResponseEntity.SUCCESS, "修改成功");
    }

    /**
     * @Author: 李英勇
     * @Description: 通过vid删除视频
     * @DateTime: 2020/7/23 11:41
     * @Params: [vid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.String>
     */
    @PostMapping("/del")
    public ResponseEntity<Void> delVideoByVid(int vid) {
        videoService.delVideoByVid(vid);
        return new ResponseEntity<Void>(ResponseEntity.SUCCESS, "删除成功");
    }

    /**
     * @Author: 李英勇
     * @Description: 增加学生进差生池
     * @DateTime: 2020/7/24 15:35
     * @Params: []
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @GetMapping("/addPool")
    public ResponseEntity<Void> addBadPool(HttpServletRequest request) {
        String refreshToken = request.getHeader("refreshToken");
        classScoreService.addBadStuPool(refreshToken);
        return new ResponseEntity<>(ResponseEntity.SUCCESS, "更新差生池成功");
    }

    /**
     * @Author: 李英勇
     * @Description: 查询差生池中的学生
     * @DateTime: 2020/7/24 16:07
     * @Params: [refreshToken]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.Map < java.lang.String, java.util.List < com.woniuxy.commons.entity.StudentInfo>>>
     */
    @GetMapping("/findBadStu")
    public ResponseEntity<Map<String, List<StudentInfo>>> findBadStu(HttpServletRequest request) {
        String refreshToken = request.getHeader("refreshToken");
        Map<String, List<StudentInfo>> badStudent = badStudentPoolService.findBadStudent(refreshToken);
        return new ResponseEntity<>(ResponseEntity.SUCCESS, "查询成功", badStudent);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过学生id获取学生所有的试卷
     * @DateTime: 2020/7/24 16:59
     * @Params: [sid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.TestPaper>>
     */
    @GetMapping("/findTestPaperBySid/{sid}")
    public ResponseEntity<List<TestPaper>> findTestPaperBySid(@PathVariable("sid") int sid) {
        List<TestPaper> testPapers = badStudentPoolService.findTestPaperBySid(sid);
        return new ResponseEntity<List<TestPaper>>(ResponseEntity.SUCCESS, "查询成功", testPapers);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过试卷id和学生id查询试卷详情
     * @DateTime: 2020/7/28 11:45
     * @Params: [paperid, userid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<com.woniuxy.commons.entity.AnswerSheet>
     */
    @GetMapping("/getAnswerSheet/{paperId}/{userid}")
    public ResponseEntity<AnswerSheet> getAnswerSheetByRemoteUser(@PathVariable("paperId") Integer paperid, @PathVariable("userid") Integer userid) {
        AnswerSheet answerSheet = remoteAnswerService.getAnswerSheetByRemoteUser(paperid, userid);
        return new ResponseEntity<AnswerSheet>(ResponseEntity.SUCCESS, "查询成功", answerSheet);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过试卷id获取试卷的答题卡相关信息
     * @DateTime: 2020/7/28 11:49
     * @Params: [paperID]
     * @Return com.woniuxy.commons.entity.ResponseEntity<com.woniuxy.commons.entity.TestPaper>
     */
    @GetMapping("/getPaper/{paperID}")
    public ResponseEntity<TestPaper> getPaperById(@PathVariable("paperID") Long paperID) {
        TestPaper testPaper = remotePaperService.getPaperById(paperID);
        return new ResponseEntity<TestPaper>(ResponseEntity.SUCCESS, "查询成功", testPaper);
    }

    /**
     * @Author: 李英勇
     * @Description: 通过tmids获取班主任所管的班级以及所有的学生
     * @DateTime: 2020/7/28 15:32
     * @Params: [request]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.Map < java.lang.String, java.util.List < com.woniuxy.commons.entity.StudentInfo>>>
     */
    @GetMapping("/findStusByTmids")
    public ResponseEntity<Map<String, List<StudentInfo>>> findStusByTmids(HttpServletRequest request) {
        String refreshToken = request.getHeader("refreshToken");
        Map<String, List<StudentInfo>> map = classTeacherService.findStudentByTmid(refreshToken);
        return new ResponseEntity<Map<String, List<StudentInfo>>>(ResponseEntity.SUCCESS, "查询成功", map);
    }

    /**
     * @Author: 李英勇
     * @Description: 初始化加载老师对应的班级和年级
     * @DateTime: 2020/7/30 11:34
     * @Params: [request]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.wyh.TeamInfo>>
     */
    @GetMapping("/findClazz")
    public ResponseEntity<List<TeamInfo>> findClazz(HttpServletRequest request) {
        String refreshToken = request.getHeader("refreshToken");
        List<TeamInfo> clazz = classTeacherService.findClazz(refreshToken);
        return new ResponseEntity<List<TeamInfo>>(ResponseEntity.SUCCESS, "查询成功", clazz);
    }

    /**
     * @Author: 李英勇
     * @Description: 查询学生某次考试下的成绩
     * @DateTime: 2020/7/30 11:35
     * @Params: [testPaper, request, clazz]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.AnswerSheet>>
     */
    @GetMapping("/findScore")
    public ResponseEntity<List<AnswerSheet>> findScore(TestPaper testPaper, HttpServletRequest request, String clazz) {
        String refreshToken = request.getHeader("refreshToken");
        System.out.println(testPaper + ":" + clazz);
        List<AnswerSheet> score = classScoreInfoService.findScore(testPaper, refreshToken, clazz);
        return new ResponseEntity<List<AnswerSheet>>(ResponseEntity.SUCCESS, "查询成功", score);
    }

    /**
     * @Author: 李英勇
     * @Description: 查询学生所有月考成绩
     * @DateTime: 2020/7/30 11:52
     * @Params: []
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.util.Map < java.lang.String, java.util.List < com.woniuxy.commons.entity.Answer>>>
     */
    @GetMapping("/findMonthScore")
    public ResponseEntity<Map<String, List<AnswerSheet>>> findMonthScore(TestPaper testPaper, HttpServletRequest request, String clazz) {
        String refreshToken = request.getHeader("refreshToken");
        Map<String, List<AnswerSheet>> map = classScoreInfoService.findMonthScore(testPaper, refreshToken, clazz);
        return new ResponseEntity<Map<String, List<AnswerSheet>>>(ResponseEntity.SUCCESS, "查询成功", map);
    }

    /**
     * @Author: 李英勇
     * @Description: 办理退学
     * @DateTime: 2020/7/28 16:57
     * @Params: [sid]
     * @Return com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/quitSchoolForStu")
    public ResponseEntity<Void> doQuitForStu(Integer sid) {
        quitSchoolService.doQuitForStu(sid);
        return new ResponseEntity<Void>(ResponseEntity.SUCCESS, "已提交退学申请，请等待年级主任审核");
    }

    /**
     * @Author: 李英勇
     * @Description: 通过老师id获取老师的信息
     * @DateTime: 2020/7/28 17:34
     * @Params: [request]
     * @Return com.woniuxy.commons.entity.ResponseEntity<com.woniuxy.commons.entity.wyh.TeacherInfo>
     */
    @GetMapping("/findTeacherInfo")
    public ResponseEntity<TeacherInfo> findTeacherInfo(HttpServletRequest request) {
        String refreshToken = request.getHeader("refreshToken");
        //从redis获取教师Id
        Map<Object, Object> data = redisTemplate.opsForHash().entries(refreshToken);
        Integer rid = (Integer) data.get("rid");
        TeacherInfo teacherInfo = classTeacherService.findTeacherByTcid(rid);
        return new ResponseEntity<TeacherInfo>(ResponseEntity.SUCCESS, "查询成功", teacherInfo);
    }


    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:52
     * @Description: 录入学生信息
     * @Param: [file, refreshToken, classId]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/addinfo")
    public ResponseEntity<Void> enteringStudentInfo(MultipartFile filee, HttpServletRequest request, Integer classId) {
        System.out.println(filee);
        System.out.println(classId);
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.StudentInfoEnteringService(filee, request, classId);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:52
     * @Description: 修改学生密码
     * @Param: [stuid]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @RequestMapping("/uppwd")
    public ResponseEntity<Void> updateStudentPwd(Integer stuId) {
        System.out.println("学生Id为：" + stuId);
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.updateStudentPwd(stuId);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/28/028 17:49
     * @Description: 初始化学生转班信息
     * @Param: []
     * @return: com.woniuxy.commons.entity.ResponseEntity<com.woniuxy.commons.entity.wyh.TeamInfo>
     */
    @GetMapping("/initChangeClass")
    public ResponseEntity<List<TeamInfo>> initChangeClass(HttpServletRequest request) {
        ResponseEntity<List<TeamInfo>> responseEntity = new ResponseEntity<>();
        //获取所有班级信息
        List<TeamInfo> teamInfos = classTeacherService.iniChangeClass(request);
        responseEntity.setData(teamInfos);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:52
     * @Description: 学生转班
     * @Param: [changeClass, refreshToken]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/changeclass")
    public ResponseEntity<Void> changeclass(ChangeClass changeClass, HttpServletRequest request) {
        System.out.println(changeClass);
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.changeClass(changeClass, request);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:52
     * @Description: 针对当前登录班主任的转班列表
     * @Param: []
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.ChangeClass>>
     */
    @GetMapping("/changeclasslist")
    public ResponseEntity<List<ChangeClass>> changeClassList(HttpServletRequest request) {
        ResponseEntity<List<ChangeClass>> responseEntity = new ResponseEntity<>();
        List<ChangeClass> list = classTeacherService.changeClassList(request);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        responseEntity.setData(list);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:52
     * @Description: 拒绝学生转班
     * @Param: [changeClassId]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/refuse")
    public ResponseEntity<Void> refuseChangeClass(Integer changeClassId) {
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.refuseStudentChangeClass(changeClassId);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:53
     * @Description: 接受学生转班
     * @Param: [changeClass]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/consent")
    public ResponseEntity<Void> consentChangeClass(ChangeClass changeClass) {
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.consentStudentChangeClass(changeClass);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:53
     * @Description: excel录入学生高考成绩
     * @Param: [file, refreshToken]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/addCollegeEntranceScore")
    public ResponseEntity<Void> enteringScore(MultipartFile filee, HttpServletRequest request, Integer classId) {
        System.out.println(filee);
        System.out.println(classId);
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        classTeacherService.addCollegeEntranceScore(filee, request, classId);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }


    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:53
     * @Description: 获取班主任的班级
     * @Param: [refreshToken]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.wyh.TeamInfo>>
     */
    @GetMapping("/findclassmasterclass")
    public ResponseEntity<List<TeamInfo>> findClassMasterClass(HttpServletRequest request) {
        ResponseEntity<List<TeamInfo>> responseEntity = new ResponseEntity<>();
        List<TeamInfo> teamInfos = classTeacherService.initEnteringStudentInfoClass(request);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        responseEntity.setData(teamInfos);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/25/025 14:53
     * @Description: 上传试卷
     * @Param: [file, refreshToken, paperType, grade]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.lang.Void>
     */
    @PostMapping("/uploadingTestPaper")
    public ResponseEntity<Void> uploadingTestPaper(@RequestBody MultipartFile filee, @RequestParam("refreshToken") String refreshToken, @RequestParam("paperType") Integer paperType, @RequestParam("grade") String grade) {
        ResponseEntity<Void> responseEntity = new ResponseEntity<>();
        System.out.println(filee);
        System.out.println(paperType);
        System.out.println(grade);
        classTeacherService.uploadingTestPapera(filee, refreshToken, paperType, grade);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        return responseEntity;
    }

    /**
     * @Author: 牟强
     * @Date: 2020/7/28/028 10:13
     * @Description: 初始化上传学生信息页面
     * @Param: [request]
     * @return: com.woniuxy.commons.entity.ResponseEntity<java.util.List < com.woniuxy.commons.entity.wyh.TeamInfo>>
     */
    @GetMapping("/initAddStudent")
    public ResponseEntity<List<TeamInfo>> initAddstudentInfo(HttpServletRequest request) {
        ResponseEntity<List<TeamInfo>> responseEntity = new ResponseEntity<>();
        List<TeamInfo> teamInfos = classTeacherService.initEnteringStudentInfoClass(request);
        responseEntity.setCode(ResponseEntity.SUCCESS);
        responseEntity.setData(teamInfos);
        return responseEntity;
    }

}
